﻿
using Castle.MonoRail.Framework;

using StateTheater.Models;

namespace StateTheater.Component
{
    public class PersonComponent : ViewComponent
    {
		[ViewComponentParam(Default="PersonList-Name")]
		public string cssClass { get; set; }

		[ViewComponentParam(Required=true)]
		public NameDetails Person { get; set; }

		[ViewComponentParam(Default="default")]
		public string View { get; set; }

		[ViewComponentParam]
		public string otherCell { get; set; }

        /// <summary>
        /// Initializes a new instance of the PersonComponent class.
        /// </summary>

        public override void Render()
        {
            base.Render();
            Person.FirstName = Person.FirstName ?? "";
//            Person.SEOName = Util.SEOEscape(Person.FullName ?? "", true);
            PropertyBag["person"] = Person;
            PropertyBag["cssClass"] = cssClass;
            PropertyBag["OtherCell"] = otherCell;
            this.RenderView(View);
        }
    }
}
